package com.escool.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.escool.dao.MateriaDAO;
import com.escool.model.TbMateria;
@Service
public class MateriaServiceImpl implements MateriaService {
	
	@Autowired
	MateriaDAO materiaDAO;

	@Transactional
	public void addMateria(TbMateria materia) {
		materiaDAO.addMateria(materia);

	}

	@Transactional
	public void updateMateria(TbMateria materia) {
		materiaDAO.updateMateria(materia);

	}

	@Transactional
	public List<TbMateria> listMateria() {
		return materiaDAO.listMateria();
	}

	@Transactional
	public void deleteMateria(Integer id) {
		materiaDAO.deleteMateria(id);

	}

}
